


        
          var watchWindowWidth = null;
          $(document).ready(function(){
                $('.grid').masonry({
                    itemSelector:'.grid-item',
                    columnWidth:'.grid-sizer',
                    percentPosition:true,
                    resize:true
                });
                $('.grid').masonry({gutter:15});
                $('.grid')[0].gutter = 15;
                if(window.innerWidth >= 768){
                    $('.grid').masonry({gutter:15});
                    $('.grid')[0].gutter = 15;
                }else{
                    $('.grid').masonry({gutter:0});
                    $('.grid')[0].gutter = 0;
                }
                
                watchWindowWidth = setInterval(function(){
                    if(window.innerWidth >= 768){
                        if($('.grid')[0].gutter == 15) return false;
                        $('.grid').masonry({gutter:15});
                        $('.grid')[0].gutter = 15;
                    }else{
                        if($('.grid')[0].gutter == 0) return false;
                        $('.grid').masonry({gutter:0});
                        $('.grid')[0].gutter = 0;
                    }
                })

                var linkNow = window.location.href;
                for(var n = 0;n < $('main .news .categories a').length;n++){
                    var href = $('main .news .categories a').eq(n).attr('href');
                    if(linkNow.indexOf('=') >= 0 && href.indexOf('=') >= 0 && linkNow.indexOf(href) >= 0){
                        $('main .news .categories a').eq(n).addClass('active');
                        break;
                    }else if(linkNow.indexOf('=') < 0 && linkNow.indexOf(href) >= 0){
                        $('main .news .categories a').eq(n).addClass('active');
                        break;
                    }
                }
          })